import React, { useEffect, useState } from 'react'

import styles from './index.module.css'
import { useLocation } from 'react-router-dom'

import PubSub from 'pubsub-js'
import { ACTION_USER_NAME } from '../../pubSub/constant'

function Winnow(props) {

    const [value, setValue] = useState('---')


    let a = useLocation();
    // let aaa = a.state.item;
    var token = PubSub.subscribe(ACTION_USER_NAME, function (msg, data) {
        console.log(msg, data);


    });


    //[]空数组相当于componentDidMount
    useEffect(() => {
        console.log('Winnow页面初始化了')



        return () => {
            PubSub.unsubscribe(token);

        }
    }, []);


    //渲染组件
    return (<div style={{ width: '96vw', height: '100vh', overflowY: 'scroll' }}>
        <div>1这是精选页面</div>
        <div>2这是精选页面</div>
        <div>3这是精选页面</div>
        <div>1这是精选页面</div>
        <div>2这是精选页面</div>
        <div>3这是精选页面</div>
        <div>1这是精选页面</div>
        <div>2这是精选页面</div>
        <div>3这是精选页面</div>
        <div>4这是精选页面</div>
        <div>5这是精选页面</div>
        <div>6这是精选页面</div>
        <div>这是精选页面</div>
        <div>这是精选页面</div>
        <div>1这是精选页面</div>
        <div>2这是精选页面</div>
        <div>3这是精选页面</div>
        <div>4这是精选页面</div>
        <div>5这是精选页面</div>
        <div>6这是精选页面</div>
        <div>这是精选页面</div>
        <div>这是精选页面</div>
        <div>1这是精选页面</div>
        <div>2这是精选页面</div>
        <div>3这是精选页面</div>
        <div>4这是精选页面</div>
        <div>5这是精选页面</div>
        <div>6这是精选页面</div>
        <div>这是精选页面</div>
        <div>这是精选页面</div>
        <div>1这是精选页面</div>
        <div>2这是精选页面</div>
        <div>3这是精选页面</div>
        <div>4这是精选页面</div>
        <div>5这是精选页面</div>
        <div>6这是精选页面</div>
        <div>这是精选页面</div>
        <div>这是精选页面</div>
        <div>1这是精选页面</div>
        <div>2这是精选页面</div>
        <div>3这是精选页面</div>
        <div>4这是精选页面</div>
        <div>5这是精选页面</div>
        <div>6这是精选页面</div>
        <div>这是精选页面</div>
        <div>这是精选页面</div>
        <div>1这是精选页面</div>
        <div>2这是精选页面</div>
        <div>3这是精选页面</div>
        <div>4这是精选页面</div>
        <div>5这是精选页面</div>
        <div>6这是精选页面</div>
        <div>这是精选页面</div>
        <div>这是精选页面</div>
    </div>

    )
}

export default Winnow;
